package com.tmxk.days01.demo3_pets_wmh;

/**
 *  Cat   静态特征(属性)昵称     年龄   种类   颜色 	 动态行为(方法) 叫     捉老鼠
 *
 */
public class Cat extends Pet {
    private String color;

    public String getColor() {
        return color;
    }
    public void setColor(String color) {
        this.color = color;
    }

    public Cat() {
    }


    public Cat(String name) {
        //常识: 调用父类构造时,父类构造必须放在首行
        super(name);
        super.setName(name);
    }
    public Cat(String name, int age, String strain, String color) {
        super(name, age, strain);
        this.color = color;
    }

    /**
     * 叫的方法
     */
    public void shout(){
        System.out.println(this.getName() + "在喵喵的叫");
    }

    public void catchMice(){
        System.out.println(this.getName() + "擅长捉老鼠");
    }

    public void showInfo(){
        System.out.println("宠物的基本信息是: 昵称是: "+ this.getName() + " ,年龄是: "+ this.getAge()
                +" , 种类是: "+ this.getStrain() +"  ,颜色是:" + this.color );
    }

    @Override
    public float calRent(int days) {
        return 0;
    }
}

